#pragma once
#include "ActorComponent.h"
#include "Geometry.h"

class MoveComponent2D : public ActorComponent
{
protected:
	Vec2 m_velocity;
	double m_angularVelocity;

public:
	static const char* g_name;
	static const ComponentId& g_ID;

	MoveComponent2D() { }
	virtual bool VInit(tinyxml2::XMLElement* pData) override;
	virtual const char *VGetName() const override { return g_name; }
	virtual void VUpdate(double deltaSecs) override;

	Vec2 GetVelocity() const { return m_velocity; }
	void SetVelocity(const Vec2& value) { m_velocity = value; }
	double GetAngularVelocity() const { return m_angularVelocity; }
	void SetAngularVelocity(const double& value) { m_angularVelocity = value; }
};

extern ActorComponent* CreateMoveComponent2D();